Previous Book Contents Book Index Next

Inside Macintosh: Programming With JManager /
Chapter 2 - JManager Reference / JManager Constants and Data Types
The Java Runtime Session


Session Callbacks Structure

When you create an instantiation of the Java runtime environment using the JMOpenSession function, you must pass a data structure that supplies callback information for that instantiation. The session callbacks data structure is defined by the JMSessionCallbacks data type.

struct JMSessionCallbacks {
   UInt32               fVersion;        /* set to kJMVersion */
   JMConsoleProcPtr     fStandardOutput; /* standard output */
   JMConsoleProcPtr     fStandardError;  /* standard error */
   JMConsoleReadProcPtr fStandardIn;     /* standard input */
};
Field Description
fVersion
The version of JManager. You should set this field to kJMVersion.
fStandardOutput
A pointer to a function that handles text sent to the standard output. JManager sends all console output to this function. This callback has the following type definition:
               typedef void (*JMConsoleProcPtr) (
                  JMSessionRef session, const char* message, 
                  UInt32 messageLen);
For more information, see the description of the application-defined function MyStandardOutput (page 97).
fStandardError
A pointer to a function that handles standard error output. JManager sends any error messages to this function. This callback has the following type definition:
               typedef void (*JMConsoleProcPtr) (
                  JMSessionRef session, const char* message,
                  UInt32 messageLen);
For more information, see the description of the application-defined function MyStandardError (page 98).
fStandardIn
A pointer to a function that handles console input. JManager accepts input from this routine. This value can be a null pointer, which indicates default behavior (no console input). This callback has the following type definition:
               typedef SInt32 (*JMConsoleReadProcPtr) (
                  JMSessionRef session, char* buffer, 
                  SInt32 maxBufferLength);
For more information, see the description of the application-defined function MyStandardIn (page 98).

Previous Book Contents Book Index Next

© Apple Computer, Inc.
23 APR 1997